<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<!--
        	if(条件表达式){
        		语句一
        	}else if(条件表达式){
        		语句二
        	}else{
        		语句三
        	}
        -->
        <script>
        	function validate(number){
        		switch(number){
	        		case 1:
	        			alert("case 1");
        			
	        		case 2:
	        			alert("case 2");
	        		
	        		case 3:
	        			alert("case 3");
	        		
	        		default:
	        			alert("default");//default容易写错
	        	}
        	}
        	validate();
        </script>
	</head>
	<body>
		
	</body>
</html>
